<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta name="description" content="Play minecraft 1.8 in your browser" />
		<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
		<title>MC.JS WebMC 1.8.8 Plus</title>
		<meta property="og:locale" content="zh-CN" />
		<meta property="og:type" content="website" />
		<meta property="og:title" content="EaglercraftX 1.8" />
		<meta property="og:description" content="Play minecraft 1.8 in your browser" />
		<meta property="og:image" content="favicon.png" />
		<link type="image/png" rel="shortcut icon" href="favicon.png" />
		<script type="text/javascript" src="classes.js"></script>
		<script type="text/javascript">
			"use strict";
			window.addEventListener("load", () => {
				if(document.location.href.startsWith("file:")) {
					alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
				}else {
					
					// %%%%%%%%% launch options %%%%%%%%%%%%
					
					const relayId = Math.floor(Math.random() * 3);
					window.eaglercraftXOpts = {
						demoMode: false,
						container: "game_frame",
						assetsURI: "assets.epk",
						localesURI: "lang/",
						lang: "zh_CN",
						worldsDB: "worlds",
						servers: [
							/* example: { addr: "ws://localhost:8081/", name: "Local test server" } */
						],
						relays: [
							//{ addr: "ws://relay-server.mc.js.cool:45317", comment: "MC.JS.COOL FAST NET PRO V2", primary: relayId == 0 },
							{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId == 1 },
							{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId == 2 },
							{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId == 3 }
						]
					};
					
					// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
					
					var q = window.location.search;
					if(typeof q === "string" && q.startsWith("?")) {
						q = new URLSearchParams(q);
						var s = q.get("server");
						if(s) window.eaglercraftXOpts.joinServer = s;
					}
					
					main();
					
				}
			});
		</script>
	</head>
	<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
	</body>
</html>